﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SiteMaster.Master" AutoEventWireup="true"
    CodeBehind="FicsalReport.aspx.cs" Inherits="GuessLAB.FicsalReport" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </cc1:ToolkitScriptManager>
    <script type="text/javascript">


        function ConfirmDelete() {

            var ret = false;
            if (confirm("Are you sure you want to delete this time period, Action can not be taken back"))
                ret = true;
            else
                ret = false;

            //alert(ret);
            return ret;

        }



    </script>
    <%--.left
{
text-align="left"
}--%>
    <%--<table runat ="server" id="formtable">
        <tr>
            <td>
                <asp:Label ID="lblYear" runat="server" Text="Year"></asp:Label>
                </td>
                <td>
                <asp:TextBox ID="txtyear" runat="server" align="left"></asp:TextBox>
            </td>
        <td>&nbsp;</td>    
            <td>
                <asp:Label ID="Label1" runat="server" Text="FISCAL NUM"></asp:Label>
            </td>
                <td>
                <asp:TextBox ID="txtfascalnum" runat="server"></asp:TextBox>
            </td>
        </tr>
         
       <tr>
            <td>
                <asp:Label ID="Label3" runat="server" Text="FISCAL START DATE"  ></asp:Label>
                 </td>
                <td>
                <asp:TextBox ID="txtFISCALSTARTDATE" runat="server"></asp:TextBox>
                <asp:ImageButton ID="imgPopup1" ImageUrl="images/calendar.png" ImageAlign="Bottom" runat="server" />
<cc1:CalendarExtender ID="Calendar1" PopupButtonID="imgPopup1" runat="server" TargetControlID="txtFISCALSTARTDATE"  Format="M/d/yyyy">
</cc1:CalendarExtender>
            </td>
        <td>&nbsp;</td>    
            <td>
                <asp:Label ID="Label2" runat="server" Text="FISCAL END DATE"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtFISCALENDDATE" runat="server"></asp:TextBox>
                   <asp:ImageButton ID="ImageButton1" ImageUrl="images/calendar.png" ImageAlign="Bottom" runat="server" />
<cc1:CalendarExtender ID="CalendarExtender1" PopupButtonID="ImageButton1" runat="server" TargetControlID="txtFISCALENDDATE"  Format="M/d/yyyy">
</cc1:CalendarExtender>
            </td>
        </tr>
       
         <tr>
            <td>
                <asp:Label ID="Label4" runat="server" Text="FISCAL PERIOD"></asp:Label>
            </td>
           <td>
                <asp:TextBox ID="txtFISCALPERIOD" runat="server"></asp:TextBox>
            </td>
       <td>&nbsp;</td>    
            <td>
               
                <asp:Button ID="Save" runat="server" Text="Add" onclick="Save_Click" />
               
            </td>
            <td>
              
                <asp:Button ID="Cancel" runat="server" Text="Cancel" onclick="Cancel_Click" CausesValidation="False" />
              
            </td>
        </tr>  
    </table>--%>
    <div style="text-align:left !important;">
        <asp:Label ID="lblYear" runat="server" Text="Year" Width="40px"></asp:Label>
        <asp:TextBox ID="txtyear" runat="server" align="left" Width="60px" ToolTip="EnterYear"></asp:TextBox>
        <asp:Label ID="Label1" runat="server" Text="FISCAL NUM" Width="100px"></asp:Label>
        <asp:TextBox ID="txtfascalnum" runat="server" Width="40px" ToolTip="EnterFiscalMonthNumber"></asp:TextBox>
        <asp:Label ID="Label3" runat="server" Text="FISCAL START DATE" Width="140px"></asp:Label>
        <asp:TextBox ID="txtFISCALSTARTDATE" runat="server" Width="80px" ToolTip="EnterFiscal Start Date"></asp:TextBox>
        <asp:ImageButton ID="imgPopup1" ImageUrl="images/calendar.png" ImageAlign="Bottom"
            runat="server" />
        <cc1:CalendarExtender ID="Calendar1" PopupButtonID="imgPopup1" runat="server" TargetControlID="txtFISCALSTARTDATE"
            Format="M/d/yyyy">
        </cc1:CalendarExtender>
        <asp:Label ID="Label2" runat="server" Text="FISCAL END DATE" Width="140px"></asp:Label>
        <asp:TextBox ID="txtFISCALENDDATE" runat="server" Width="80px" ToolTip="Enter FiscalEnd date"></asp:TextBox>
        <asp:ImageButton ID="ImageButton1" ImageUrl="images/calendar.png" ImageAlign="Bottom"
            runat="server" />
        <cc1:CalendarExtender ID="CalendarExtender1" PopupButtonID="ImageButton1" runat="server"
            TargetControlID="txtFISCALENDDATE" Format="M/d/yyyy">
        </cc1:CalendarExtender>
        <asp:Label ID="Label4" runat="server" Text="FISCAL PERIOD" Width="110px"></asp:Label>
        <asp:TextBox ID="txtFISCALPERIOD" runat="server" Width="80px" ToolTip="EnterFiscalPeriod"></asp:TextBox>
        <asp:ImageButton ID="Save" runat="server" ImageUrl="~/images/Add-button.png" OnClick="Save_Click"
            Height="16px" Width="16px" ToolTip="Click to add fiscal period" />
        <asp:ImageButton ID="Cancel" runat="server" ImageUrl="~/images/Cancel-icon.png" Height="16px"
            Width="16px" OnClick="Cancel_Click" CausesValidation="False" />
    </div>
    <%-- <table runat ="server" id="formtable">
         <tr>
            <td>
                
            </td>
        </tr>  
    </table>--%>
    <br />
    <br />
    <asp:GridView ID="grdList" DataKeyNames="FiscalReportId" runat="server" AutoGenerateColumns="False"
        CssClass="Gridview" HeaderStyle-BackColor="#61A6F8" ShowFooter="True" HeaderStyle-Font-Bold="true"
        HeaderStyle-ForeColor="White" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None"
        CellPadding="3" AllowPaging="True" PageSize="5" OnPageIndexChanging="grdList_PageIndexChanging"
        OnRowCancelingEdit="grdList_RowCancelingEdit" OnRowDeleting="grdList_RowDeleting"
        OnRowEditing="grdList_RowEditing" OnRowUpdating="grdList_RowUpdating" OnRowUpdated="grdList_RowUpdated"
        OnRowCommand="grdList_RowCommand" ToolTip="FiscalPeriodView">
        <Columns>
            <asp:BoundField DataField="YEAR" HeaderText="YEAR" />
            <asp:BoundField DataField="FISCALNUM" HeaderText="FISCAL NUM" />
            <asp:BoundField DataField="FISCALPeriod" HeaderText="FISCAL Period" />
            <%--<asp:BoundField DataField ="FISCALSTARTDATE" HeaderText ="FISCAL START DATE" DataFormatString="{0:d}"  />--%>
            <%--<asp:BoundField DataField ="FISCALENDDATE" HeaderText ="FISCAL END DATE" DataFormatString="{0:d}" />--%>
            <%--
<asp:TemplateField headertext="Discontinued Date" Visible="false">
                     <ItemTemplate> <%#Eval("FISCALSTARTDATE", "{0:d}")%></ItemTemplate>
                     <EditItemTemplate>
                     <img id="imgCalendar" src="images/calendar.png" height="25px" style="cursor:pointer"
                        onclick="fnShowCalendar('<%# ((GridViewRow)Container).FindControl("tbxDate").ClientID %>', 300, 180);" />
                      <asp:TextBox ID="tbxDate" runat="server" Text='<%#Eval("FISCALSTARTDATE","{0:d}")%>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>--%>
            <asp:TemplateField HeaderText="FISCAL START DATE">
                <ItemTemplate>
                    <%#Eval("FISCALSTARTDATE", "{0:d}")%></ItemTemplate>
                <EditItemTemplate>
                    <asp:ImageButton ID="ImageButtonFiscalStart" ImageUrl="images/calendar.png" ImageAlign="Bottom"
                        runat="server" />
                    <asp:TextBox ID="gdFiscalStart" runat="server" Text='<%#Eval("FISCALSTARTDATE","{0:d}")%>'></asp:TextBox>
                    <cc1:CalendarExtender ID="CalendarExtenderFiscalStart" PopupButtonID="ImageButtonFiscalStart"
                        runat="server" TargetControlID="gdFiscalStart" Format="M/d/yyyy">
                    </cc1:CalendarExtender>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="FISCAL END DATE">
                <ItemTemplate>
                    <%#Eval("FISCALENDDATE", "{0:d}")%></ItemTemplate>
                <EditItemTemplate>
                    <asp:ImageButton ID="ImageButtonFiscalEnd" ImageUrl="images/calendar.png" ImageAlign="Bottom"
                        runat="server" />
                    <asp:TextBox ID="gdFiscalEnd" runat="server" Text='<%#Eval("FISCALENDDATE","{0:d}")%>'></asp:TextBox>
                    <cc1:CalendarExtender ID="CalendarExtenderFiscalEnd" PopupButtonID="ImageButtonFiscalEnd"
                        runat="server" TargetControlID="gdFiscalEnd" Format="M/d/yyyy">
                    </cc1:CalendarExtender>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField ShowHeader="False" HeaderStyle-HorizontalAlign="Center">
                <EditItemTemplate>
                    <asp:ImageButton ID="LBUpdate" runat="server" CausesValidation="False" CommandName="Update"
                        Height="16px" Width="16px" ImageUrl="~/images/ok-icon.png" CommandArgument='<%# Bind("FiscalReportId") %>' />
                    <asp:ImageButton ID="LBCancel" runat="server" CausesValidation="False" CommandName="Cancel"
                        Height="16px" Width="16px" ImageUrl="~/images/Cancel-icon.png" />
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:ImageButton ID="LBEdit" runat="server" CausesValidation="False" CommandName="Edit"
                        Height="16px" Width="16px" ImageUrl="~/images/edit-icon.png" />
                    <asp:ImageButton ID="LinkButton4" runat="server" CausesValidation="False" CommandArgument='<%# Bind("FiscalReportId") %>'
                        CommandName="Delete" Height="16px" Width="16px" ImageUrl="~/images/delete-icon.png"
                        OnClientClick='return ConfirmDelete();' />
                </ItemTemplate>
                <HeaderStyle HorizontalAlign="Center" />
            </asp:TemplateField>
            <asp:TemplateField ShowHeader="False" HeaderStyle-HorizontalAlign="Center" Visible="false">
                <ItemTemplate>
                    <asp:LinkButton ID="LBEditAddSudents" runat="server" CausesValidation="False" CommandName="EditSudentsCourse"
                        Text="AddCourses" CommandArgument='<%# Bind("FiscalReportId") %>'></asp:LinkButton>
                </ItemTemplate>
                <HeaderStyle HorizontalAlign="Center" />
            </asp:TemplateField>
            <asp:BoundField DataField="FiscalReportId" HeaderText="FiscalReportId" Visible="false" />
        </Columns>
        <FooterStyle BackColor="White" ForeColor="#000066" />
        <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White"></HeaderStyle>
        <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
        <RowStyle ForeColor="#000066" />
        <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
        <%--<SortedAscendingCellStyle BackColor="#F1F1F1" />
      <SortedAscendingHeaderStyle BackColor="#007DBB" />
      <SortedDescendingCellStyle BackColor="#CAC9C9" />
      <SortedDescendingHeaderStyle BackColor="#00547E" />--%>
    </asp:GridView>
</asp:Content>
